<?php 	

	class UserCache extends RedisMem {

		/**
		 * 检查登陆密码验证码缓存,5次输入错误就返回true
		 */
		public function checkPasswordVerifyCodeCache() {
			$ip = IP::getIP();
			$cachekey = "checkpassword_".$ip;

			$num = $this->get_json($cachekey);
			if (empty($num)) {
				$num = 0;
			}

			if ($num > 5) {
				return true;
			}

			return false;
		}

		public function setPasswordVerifyCodecache() {
			$ip = IP::getIP();
			$cachekey = "checkpassword_".$ip;

			//读缓存
			$num = $this->increment($cachekey);
			$this->expire($cachekey, 3600);
			return $num;
		}


	}